<!doctype  html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head th:include="common/common::sources(title='用户管理')"></head>
<body>
	<!-- 头部 -->
	<div th:include="components/header::navbar"></div>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<a class="menu-toggler" id="menu-toggler" href="#"> <span
				class="menu-text"></span>
			</a>
			<!-- 菜单 -->
			<div th:substituteby="components/leftbar::sidebar"></div>
			<!-- 主页面 -->
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">首页</a></li>
						<li>基本信息管理</li>
						<li class="active">用户管理</li>
					</ul>
					<!-- .breadcrumb -->
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<h3 class="header smaller lighter blue">用户管理</h3>
							<form class="form-inline" style="margin-left: 10px; float: left;"
								th:action="@{${domain}+'/account/accountlist'}" method="post">
								<div class="form-group">
									<input type="text" class="form-control" id="accountName"
										name="LIKE_accountName" placeholder="账户名称"
										th:value="${LIKE_accountName}" />
								</div>
								<button type="submit" class="btn btn-default">查询</button>
							</form>
							<p style="text-align: right; margin-right: 10px;">
								<a href="/account/add" class="btn btn-default">新增</a> <a
									class="btn btn-default">激活</a>
							</p>
							<div class="table-header">用户列表</div>
							<div class="table-responsive">
								<table id="accountList"
									class="table table-striped table-bordered table-hover">
									<thead>
										<tr>
											<th class="center"><label> <input
													type="checkbox" class="ace" /> <span class="lbl"></span>
											</label></th>
											<th class="center">账户</th>
											<th class="center">姓名</th>
											<th class="center">邮箱</th>
											<th class="center">状态</th>
											<th class="center">激活</th>
											<th class="center">时间</th>
											<th class="center"></th>
										</tr>
									</thead>
									<tbody>
										<tr
											th:if="${paginationResponse != null and #arrays.length(paginationResponse.content) > 0}"
											th:each="item:${paginationResponse.content}">
											<td class="center"><label> <input
													type="checkbox" class="ace" /> <span class="lbl"></span>
											</label></td>
											<td th:text="${item.accountName}">Account Name</td>
											<td th:text="${item.userName}">User Name</td>
											<td th:text="${item.email}">Email</td>
											<td><span class="label label-sm label-success"
												th:if="${item.accountStatus eq 1}">&nbsp;有效&nbsp;</span> <span
												class="label label-sm label-inverse"
												th:if="${item.accountStatus eq 0}">&nbsp;无效&nbsp;</span></td>
											<td><span class="label label-sm label-warning"
												th:if="${item.isActive eq 1}">&nbsp;激活&nbsp;</span> <span
												class="label label-sm label-info"
												th:if="${item.isActive eq 0}">&nbsp;未激活&nbsp;</span></td>
											<td th:text="${item.modifyDate}">Modify Date</td>
											<td>
												<div
													class="visible-md visible-lg hidden-sm hidden-xs action-buttons">
													<a class="blue"
														th:href="@{${domain}+'/account/profile/'+${item.accountKey}}">
														<i class="icon-zoom-in bigger-130"></i>
													</a> <a class="green" href="#"> <i
														class="icon-pencil bigger-130"></i>
													</a> <a class="red"
														th:onclick="@{'deleteConfirm(\'/account/delete/'+${item.accountKey}+'\');'}">
														<i class="icon-trash bigger-130"></i>
													</a>
												</div>
											</td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
					<div
						th:substituteby="components/pagination::pagination(pagination=${paginationResponse},action=${domain}+'/account/accountlist')"></div>
				</div>
			</div>
		</div>
	</div>
	<!-- js 资源 -->
	<div th:include="components/footer::basescript"></div>
	<script th:inline="javascript">
		/*<![CDATA[*/
		jQuery(function($) {
			$('table th input:checkbox').on(
					'click',
					function() {
						var that = this;
						$(this).closest('table').find(
								'tr > td:first-child input:checkbox').each(
								function() {
									this.checked = that.checked;
									$(this).closest('tr').toggleClass(
											'selected');
								});
					});
			$('[data-rel="tooltip"]').tooltip({
				placement : tooltip_placement
			});
			function tooltip_placement(context, source) {
				var $source = $(source);
				var $parent = $source.closest('table')
				var off1 = $parent.offset();
				var w1 = $parent.width();
				var off2 = $source.offset();
				var w2 = $source.width();
				if (parseInt(off2.left) < parseInt(off1.left)
						+ parseInt(w1 / 2))
					return 'right';
				return 'left';
			}
		})
		/*]]>*/
	</script>
</body>
</html>